//
//  MainViewController.m
//  Example
//
//  Created by Andney Jack on 2020/6/2.
//  Copyright © 2020 annidy. All rights reserved.
//

#import "MainViewController.h"
#import "ListViewController.h"
#import "DetailViewController.h"

@interface MainViewController ()

@end

@implementation MainViewController

- (void)viewDidLoad {
    [self.actionTitles addObject:@"返回"];
    [self.actionTitles addObject:@"详情"];
    [self.actionTitles addObject:@"列表"];

    [super viewDidLoad];

    self.navigationItem.title = @"demo";
    self.view.backgroundColor = [UIColor cyanColor];
}

- (void)handleAction:(NSString *)action
{
    if ([action isEqualToString:@"返回"]) {
        [self closePage:YES];
    } else if ([action isEqualToString:@"详情"]) {
        DetailViewController *vc = [DetailViewController new];
        vc.modalPresentationStyle = UIModalPresentationFullScreen;
        vc.modalTransitionStyle = 1;
        [self presentViewController:vc animated:YES completion:nil];
//        [self.navigationController pushViewController:[DetailViewController new] animated:YES];
    } else if ([action isEqualToString:@"列表"]) {
        [self.navigationController pushViewController:[ListViewController new] animated:YES];
    }
}

@end
